import { BasicColumn, FormProps } from '/@/components/Table';
import { NAME, MENU, OPERATE, IP, CREATED_TIME } from '/@/constant/operateLog';
import { SEARCH_ITEM_COL_PROP } from '/@/constant';

export const columns: BasicColumn[] = [
  {
    title: NAME,
    dataIndex: 'name',
  },
  {
    title: MENU,
    dataIndex: 'menu',
  },
  {
    title: OPERATE,
    dataIndex: 'operate',
  },
  {
    title: IP,
    dataIndex: 'ip',
  },
  {
    title: CREATED_TIME,
    dataIndex: 'createdTime',
  },
];

export function getFormConfig(): Partial<FormProps> {
  return {
    labelWidth: 100,
    schemas: [
      {
        field: 'name',
        label: NAME,
        component: 'Input',
        componentProps: {},
        ...SEARCH_ITEM_COL_PROP,
      },
      {
        field: 'menu',
        label: MENU,
        componentProps: {},
        component: 'Input',
        ...SEARCH_ITEM_COL_PROP,
      },
      {
        field: 'operate',
        label: OPERATE,
        component: 'Input',
        componentProps: {},
        ...SEARCH_ITEM_COL_PROP,
      },
    ],
  };
}
